# -*- coding: UTF-8 -*-
# Project : huobiao
# File : craw.py
# IDE : PyCharm
# Author : 博科（鑫贝西）田聪
# Date : 2021/10/30 11:16
import time
import datetime
from scrapy.cmdline import execute
import os
import sys

import schedule
# def start_crawl():
#     sys.path.append(os.path.dirname(os.path.abspath(__file__)))
#     execute(['scrapy', 'crawl', 'hb'])
#
# schedule.every(30).minutes.do(start_crawl)
# if __name__ == '__main__':
#
#
#     while True:
#         oldtime = datetime.datetime.now()
#         schedule.run_pending()
#         newtime = datetime.datetime.now()
#         print(f"{oldtime}开始###########{newtime}结束")
#         time.sleep(60)

while True:


    os.system("scrapy crawl hb --nolog")
    print("############    休眠600s    ##############")
    time.sleep(600)